package NoRain.Wxt;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Administrator on 2016-04-23.
 */
@WebServlet(name = "ContextConfigServlet")
public class ContextConfigServlet extends HttpServlet {


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setHeader("content-type", "text/html;charset=UTF-8");

        ServletContext context = this.getServletContext();
        String salt = context.getInitParameter("md5salt");
        String jdbcConfig = context.getInitParameter("jdbcurl");

        response.getWriter().write("\nsalt：" + salt);
        response.getWriter().write("\njdbcConfig：" + jdbcConfig);

    }
}
